import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'

const systemRouter: RouteConfig = {
  path: '/system',
  component: Layout,
  redirect: 'noRedirect',
  name: 'System',
  meta: {
    title: 'system',
    icon: 'setting',
    roles: ['admin', 'editor'], // you can set roles in root nav
    alwaysShow: true // will always show the root menu
  },
  children: [
    {
      path: 'user',
      component: () =>
        import(/* webpackChunkName: "system-user" */ '@/views/system/user.vue'),
      name: 'UserSystem',
      meta: { title: 'userSystem' }
    },
    {
      path: 'role',
      component: () =>
        import(/* webpackChunkName: "system-role" */ '@/views/system/role.vue'),
      name: 'RoleSystem',
      meta: { title: 'roleSystem' }
    },
    {
      path: 'menu',
      component: () =>
        import(/* webpackChunkName: "system-menu" */ '@/views/system/menu.vue'),
      name: 'MenuSystem',
      meta: { title: 'menuSystem' }
    },
    {
      path: 'dict',
      component: () =>
        import(/* webpackChunkName: "system-dict" */ '@/views/system/dict.vue'),
      name: 'DictSystem',
      meta: { title: 'dictSystem' }
    },
    {
      path: 'config',
      component: () =>
        import(
          /* webpackChunkName: "system-config" */ '@/views/system/config.vue'
        ),
      name: 'ConfigSystem',
      meta: { title: 'configSystem' }
    },
    {
      path: 'notice',
      component: () =>
        import(
          /* webpackChunkName: "system-notice" */ '@/views/system/notice.vue'
        ),
      name: 'NoticeSystem',
      meta: { title: 'noticeSystem' }
    },
    {
      path: 'monitor',
      component: () =>
        import(
          /* webpackChunkName: "system-monitor" */ '@/views/system/monitor/index.vue'
        ),
      name: 'Monitor',
      redirect: '/system/monitor/operlog',
      meta: { title: 'monitorSystem' },
      children: [
        {
          path: 'operlog',
          component: () =>
            import(
              /* webpackChunkName: "monitor-operlog" */ '@/views/system/monitor/operlog.vue'
            ),
          name: 'Operlog',
          meta: { title: 'operlogMonitor' }
        },
        {
          path: 'logininfor',
          component: () =>
            import(
              /* webpackChunkName: "monitor-logininfor" */ '@/views/system/monitor/logininfor.vue'
            ),
          name: 'Logininfor',
          meta: { title: 'logininforMonitor' }
        }
      ]
    }
  ]
}

export default systemRouter
